/*
============================================================================
 Name        : ScreenCapture.h
 Author      : DANG Zhengfa
 Version     :
 Copyright   : Zhengfa Company Limited
 Description : CScreenCapture declaration
============================================================================
*/

#ifndef SCREENCAPTURE_H
#define SCREENCAPTURE_H

#include <e32base.h>	// For CActive, link against: euser.lib
#include <e32std.h>		// For RTimer, link against: euser.lib
#include <f32file.h>    // For RFs, Link against: efsrv.lib


class CWsScreenDevice;
class CFbsBitmap;
class CImageEncoder;
class CFrameImageData;

class CScreenCapture : public CActive
{
public:
	// C++ constructor
	CScreenCapture();
	
	// Second-phase constructor
	void ConstructL();
	
	// Cancel and destroy
	~CScreenCapture();

public: // New functions
	// Function for making the initial request
	void StartL();

private: // From CActive
	// Handle completion
	void RunL();
	
	// How to cancel me
	void DoCancel();
	void LoadStringL();

	// Override to handle leaves from RunL(). Default implementation causes
	// the active scheduler to panic.
	//void RunError(TInt aError);

private:

private:
	CWsScreenDevice *iScreen;  // pointer to another instance, no ownership
	RFs iRF;

	CImageEncoder *iEncoder;
	CFrameImageData *iFrameImageData;
	CFbsBitmap *iBitmap;

	HBufC* iTextSuccess;
	HBufC* iTextFail;

public:
	void SetScreenDevice(CWsScreenDevice* aScreen);

	void StartCaptureL();
};

#endif
